<template>
	<view class="top">
		<input class="top-input" placeholder="请输入动作搜索"/>
		<el-button class="top-button">+</el-button>
	</view>
	<view class='center'>
		
		  <view class="common-layout">
		    <el-container>
		      <el-aside class="aside" >
			  <el-scrollbar>
			      <el-menu class="el-menu-vertical-demo" v-for="(item,i) in buweiList" :key="i">
			             <el-sub-menu  >
			               <template #title>
			                 <span @click="getdongzuo(item.id)" style="margin-left: 0;">{{item.name}}</span>
			               </template>
			                 <el-menu-item @click="console.log(index)">{{item.id}}</el-menu-item>
			             </el-sub-menu>
			           </el-menu>
			       </el-scrollbar>
			  
			  </el-aside>
		      <el-container>
		        <el-header>
				
					<scroll-view  scroll-x="true" style="white-space: nowrap;width: 100%;" >
					<view class="header">
						<view class="header-content" v-for="(item, i) in qixieList" :key="i">
							<el-button class="header-btn">{{item.name}}</el-button>
						</view>
					</view>
					</scroll-view>
					
				</el-header>
		        <el-main>
					<view class="title">
						<h2>杠铃</h2>
						<view class="actgroup">
							
							<view class="act">
								深蹲
							</view>
							<view class="act">
								1
							</view>
							<view class="act">
								1
							</view>
						</view>
					</view>
					<view class="title">
						<h2>哑铃</h2>
						<view class="actgroup">
							
							<view class="act">
								1
							</view>
							<view class="act">
								1
							</view>
							<view class="act">
								1
							</view>
						</view>
					</view>
					<view class="title">
						<h2>史密斯机</h2>
						<view class="actgroup">
							
							<view class="act">
								深蹲
							</view>
							<view class="act">
								1
							</view>
							<view class="act">
								1
							</view>
						</view>
					</view>
				</el-main>
		        <el-footer>Footer</el-footer>
		      </el-container>
		    </el-container>
		  </view>
	

	</view>
</template>
 
<script>
	export default {
		data(){
			return {
				isActive:0,
				buweiList:[
					
					
				],
				offenuse:[
					{
						id:"常用",
					},
					{
						id:"杠铃",
					},
					{
						id:2,
					},
					{
						id:2,
					},
					{
						id:2,
					},
					{
						id:2,
					},
					{
						id:2,
					}
				],
				qixieList:[],
			
		
	}},
	onLoad() {
				this.getbuwei(),
				this.getqixie()
			},
			methods:{
				
				checked(index) {
					this.isActive = index
				},
				getbuwei(){
					uni.request({
						url:'http://localhost:8080/act/selallarea',
						success: (res) => {
							console.log(res.data.data)
							this.buweiList=res.data.data
						}
					})
				},
				getqixie(){
					uni.request({
						url:'http://localhost:8080/act/selallinstrument',
						success: (res) => {
							console.log(res.data.data)
							this.qixieList=res.data.data
						}
					})
				},
				getdongzuo(index){
					uni.request({
						url:'http://localhost:8080/act/selallinstrument',
						success: (res) => {
							console.log(res.data.data)
							this.qixieList=res.data.data
						}
					})
				}
			}
	}
</script>
 
<style>
	@import url(congzuo.css);
</style>
